
package jpoco.client;

import java.util.HashMap;
import java.util.Map;

public abstract class FilterOp implements java.io.Serializable
{
	private String value;
	private String filterBy;
	
	abstract public String getType();
	
	public void setValue(String v)
	{
		this.value = v;
	}
	
	public String getValue()
	{
		return this.value;
	}
	
	public void setFilterBy(String fby)
	{
		this.filterBy = fby;
	}
	
	public String getFilterBy()
	{
		return this.filterBy;
	}
	
	public String toQueryParam()
	{
		return "filterBy=" + this.getFilterBy()
				+ "&" + "filterOp=" + this.getType() 
				+ "&" + "filterValue=" + this.getValue();
	}
	
	public Map<String, String> getParameterMap()
	{
		Map<String, String> m = new HashMap<String, String>();
		
		m.put("filterBy", this.getFilterBy());
		m.put("filterOp", this.getType());
		m.put("filterValue", this.getValue());
		
		return m;
	}
	
}
